﻿using System;
using UnityEngine;

public class PlatformCtl : MonoBehaviour
{

    float _speed;

    private Action<GameObject> _triggerEffect;


    public virtual void Start()
    {
        _speed = GameManager.Instance.PlatformSpeed;
    }


    public virtual void Update()
    {
        Movement();
    }

    public virtual void LateUpdate()
    {
        if (transform.position.y > GameManager.Instance.PlatformDestroyOffsetY)
        {
            Destroy(gameObject);
        }
    }



    void Movement()
    {
        transform.position += new Vector3(0, _speed * Time.deltaTime, 0);
    }


}
